In an image capturing device or the like, various techniques have been devised for calculating without contact a depth of a certain three-dimensional scene, that is, distance information to a subject from the image capturing device or the like. When those are roughly categorized, there are an active technique and a passive technique. In the active technique, infrared light, ultrasound, or laser is emitted to the subject, and based on a time until a reflected wave returns or an angle of the reflected wave, the distance information to the subject is calculated. In the passive technique, the distance information to the subject is calculated based on an image of the subject. Especially in a camera, the passive technique is widely used that does not require a device for emitting the infrared light or the like.
Many techniques have been devised also in the passive technique. As one of them, there is a technique called Depth from Defocus (hereinafter referred to as DFD) in which the distance information to the subject is calculated based on information of a blur, the blur changing in size and shape depending on a distance to the subject. The DFD has features such that a plurality of cameras is not required, and it is possible to calculate the distance information to the subject by using a small number of images.
Hereinafter, the principle of the DFD will be briefly described.
The DFD is a technique for calculating the distance information to the subject, based on the information of the blur, from a plurality of images respectively having focusing positions different from each other. A captured image including the information of the blur (hereinafter, referred to as a blur image) is an image in which a point spread function being a function of the distance to the subject is convoluted with an all-in-focus image representing a state without a blur due to a lens. Since the point spread function (hereinafter, referred to as the PSF) is the function of the distance to the subject, the distance information to the subject can be calculated by detecting the information of the blur from the blur image, with the DFD). However, at this time, the all-in-focus image and the distance information to the subject are unknown. Since one formula relating to the blur image, the all-in-focus image, and the distance information to the subject is established for one blur image, blur images having different focusing positions from each other are newly captured and new formulas are obtained. The obtained multiple formulas are solved, and the distance information to the subject is calculated. Regarding a method for obtaining the formula and a method for solving the formula, various methods have been devised for the DFD, including the one in PTL 1.